package net.adetech.crj.service;

import net.adetech.crj.dao.AnnouncementMapper;
import net.adetech.crj.entity.Announcement;
import net.adetech.crj.utils.InnerServiceUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("announcement.getById")
public class GetAnnouncementByIdService implements BaseService {
    @Autowired
    AnnouncementMapper announcementMapper;
    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        String id = (String) params.get("id");
        Announcement announcement = announcementMapper.getAnnounmentById(id);
        return InnerServiceUtil.buildResult("announcement",announcement);
    }
}
